<template>
  <div style="width: 100%; height: calc(100% - 32px)">
    <iframe width="100%" height="100%" name="SystemProcessWorkBench" frameborder="0" :src="url" />
  </div>
</template>

<script setup lang="ts">
import { useRoute } from "vue-router";
import { ref } from "vue";
import { getToken } from "@/utils/auth";
import { queryChildByTypeCodeAndItemValue } from "@/api/waterClass";
defineOptions({
  name: "SystemProcessWorkBench"
});
const wuToken = getToken().accessToken || "";
const { VITE_FFP_URL } = import.meta.env;
const url = ref("");
const {
  query: { taskType = "" }
} = useRoute();
queryChildByTypeCodeAndItemValue({
  value: "CATEGORY",
  typeCode: "FLOW"
}).then((response: any) => {
  if (localStorage.getItem("facCode")) {
    let ffpCode = response.filter(item => item.itemValue == "CATEGORY_SURVEY")[0].itemDesc;
    url.value = `${VITE_FFP_URL}/?ssoToken=${wuToken}&isHiddenMenu=true&language=zh-cn#/workbench?categoryCode=${ffpCode}&taskType=${taskType}`;
  }
});

// const url = `${VITE_FFP_URL}/?ssoToken=${wuToken}&isHiddenMenu=true&language=zh-cn#/workbench?categoryCode=SURVEY`;
</script>
